package com.yixiaobai.swimming.api;

import com.yixiaobai.swimming.common.ResponseData;
import com.yixiaobai.swimming.dto.request.AddEmployerReqDto;
import com.yixiaobai.swimming.dto.request.DeleteEmployerReqDto;
import com.yixiaobai.swimming.dto.request.RegisterReqDto;
import com.yixiaobai.swimming.error.ErrorCode;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

public interface EmployerApi {

    /**
     * 注册接口
     *
     * @param registerReqDto
     * @return
     */
    @ApiOperation(value = "注册")
    @PostMapping("/register")
    ResponseData<String> register(@RequestBody RegisterReqDto registerReqDto) throws Exception;

    /**
     * 登录
     * @param username
     * @param password
     * @return
     */
    @ApiOperation(value = "登录")
    @GetMapping("/login")
    ResponseData<String> login(@RequestParam(value = "username") String username,
                               @RequestParam(value = "password") String password);

    /**
     * 添加用户v1，cookie中传token，请求参数传addUser
     *
     * @param addEmployerReqDto
     * @return
     */
    @ApiOperation(value = "添加用户接口v1")
    @PostMapping("/v1/addEmployer")
    ResponseData<String> addEmployerV1(@RequestBody AddEmployerReqDto addEmployerReqDto);

    @ApiOperation(value = "删除用户接口v1")
    @PostMapping("/v1/deleteEmployer")
    ResponseData<String> deleteEmployerV1(@RequestBody DeleteEmployerReqDto deleteEmployerReqDto);

}
